package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
* 移动端套餐 列表查询
*
*/
@RestController
@RequestMapping("setmeal")
@Api(tags = "移动端-套餐管理")
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    //移动端查询所有套餐
    @GetMapping("findAllSetmeal")
    public Result findAllSetmeal(){
        return new Result(setmealService.list());
    }

    //移动端查询套餐详情
    @GetMapping("findSetmealDetailById/{id}")
    public Result findSetmealDetailById(@PathVariable("id") int id) {
        return new Result(setmealService.findSetmealDetailById(id));
    }

}
